package com.zj.fx.model.rpa;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.date.DateUtil;
import lombok.Data;

import java.util.Date;

@Data
public class RpaTask implements Serializable {
    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "任务id")
    private String id;

    @ApiModelProperty(value = "业务分类编号（1供电可靠率）")
    private String typenum;

    @ApiModelProperty(value = "任务名称")
    private String name;

    @ApiModelProperty(value = "对应指标id")
    private String targetid;

    @ApiModelProperty(value = "是否启用（0否1是）")
    private String enabled;

    @ApiModelProperty(value = "执行周期（1月度2季度3年度）")
    private String periodtype;

    @ApiModelProperty(value = "备注")
    private String memo;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    private Date createtime;


    public RpaTask(String id, String typenum, String name, String targetid, String enabled, String periodtype, String memo, Date createtime) {

        this.id = id;

        this.typenum = typenum;

        this.name = name;

        this.targetid = targetid;

        this.enabled = enabled;

        this.periodtype = periodtype;

        this.memo = memo;

        this.createtime = createtime;

    }

    public RpaTask() {
        super();
    }

    public String dateToStringConvert(Date date) {
        if (date != null) {
            return DateUtil.format(date, "yyyy-MM-dd HH:mm:ss");
        }
        return "";
    }


}